package com.yz.forlogin.controller;

import com.yz.forlogin.security.utils.JwtTokenUtils;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 段成
 * @date 2019/12/18 - 8:09
 */
@RestController
public class LoginController {

    @GetMapping("/getUsername")
    public String getUsername(@RequestParam String token){
        return JwtTokenUtils.getUsernameByToken(token);
    }
}
